﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/BodyMasterPage.Master"
    CodeBehind="wfPrograVacaMasiMnt.aspx.cs" Inherits="RH.wfPrograVacaMasiMnt" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>
<%@ Import Namespace="Texfina.Common.Mg" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <link href="../Styles/jquery-ui.custom.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/esdScheluder.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">

        $(document).ready(function () {
            Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(PageLoaded)
        });

        function PageLoaded(sender, args) {
            var menuTable = document.getElementById('<%=mnuToolbar.ClientID %>');
            var menuLinks = menuTable.getElementsByTagName("a");
            if (menuLinks != null) {
                switch (menuLinks.length) {
                    case 2:
                        menuLinks[0].onclick = function () { return validateEditForm('_BTTSAVE') }
                        break;

                    case 3:
                        menuLinks[0].onclick = function () { return validateEditForm('_BTTSAVE') }
                        menuLinks[1].onclick = function () { return validateEditForm('_BTTSAVNEW') }
                        break;
                }
            }

            var mnuGrid = document.getElementById('<%=mnuGrid.ClientID %>');
            var mnuGridLinks = mnuGrid.getElementsByTagName("a");
            if (mnuGridLinks != null) {
                switch (mnuGridLinks.length) {
                    case 1:
                        mnuGridLinks[0].onclick = function () { return validateEditFormGrid('_BTTNEW') }
                        break;
                }
            }
         
            ResizeGrid();
            $("#DataDetail").show();
            MessageOnPostback();
        }
            
        function ResizeGrid() {

                var myHeight = 0;
                if (typeof (window.innerWidth) == 'number') {
                    myHeight = window.innerHeight;
                } else if (document.documentElement && document.documentElement.clientHeight) {
                    myHeight = document.documentElement.clientHeight;
                } else if (document.body && document.body.clientHeight) {
                    myHeight = document.body.clientHeight;
                }

                var sdVac = document.getElementById('<%=scProgVaca.ClientID %>');
                sdVac.style.width = (window.innerWidth - 30).toString() + 'px';
                document.getElementById('<%=hdnSCWidth.ClientID %>').value = (window.innerWidth - 30);

                intHDif = myHeight - 165;

                sdVac.style.maxHeight = intHDif + "px";
                document.getElementById('<%=hdnSCHeight.ClientID %>').value = intHDif;

                var ScdivRig = document.getElementById('ScDivRigh');
                ScdivRig.style.maxHeight = (intHDif - 1) + "px";

                var SCList = document.getElementById('List');
                SCList.style.maxHeight = (intHDif - 58) + "px";

                var SCBody = document.getElementById('Body');
                SCBody.style.maxHeight = (intHDif - 58) + "px";

        

        }
        function panelOnUpdating() {
            updatePanelAnimationUpdating();
        }

        function panelOnUpdated() {
            ResizeGrid();
            updatePanelAnimationUpdated();
        }

        function ShowPopupScheluder(nuSecuen, itemValue, itemText, feIni, feFin, stAnulado) {

            document.getElementById('<%=hdnnuSecuen.ClientID %>').value = nuSecuen;
            document.getElementById('<%=txtidPersonal.ClientID %>').value = itemValue;
            document.getElementById('<%=txtdsPersonal.ClientID %>').value = itemText;
            document.getElementById('<%=txtfeInicio.ClientID %>').value = feIni;
            document.getElementById('<%=txtfeFin.ClientID %>').value = feFin;
            document.getElementById('<%=hdnstAnulado.ClientID %>').value = stAnulado;

            $find('<%=mdlPopup.ClientID %>').show();
        }
        
    </script>
    <style type="text/css">
        .bttAntYear
        {
            background: url('../Images/Icons/Enabled/Left24.png');
            border: none;
            width: 19px;
            height: 19px;
        }
        .bttAntYear:hover
        {
            cursor: pointer;
        }
        .bttSigYear
        {
            background: url('../Images/Icons/Enabled/Right24.png');
            border: none;
            width: 19px;
            height: 19px;
        }
        .bttSigYear:hover
        {
            cursor: pointer;
        }
        .lblyear
        {
            font-size: medium;
            font-weight: bold;
            text-align: center;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="ToolBar">
        <asp:Menu ID="mnuToolbar" runat="server" Orientation="Horizontal" CssClass="ToolBarControl"
            OnMenuItemClick="mnuToolbar_MenuItemClick">
            <Items>
                <asp:MenuItem Text="Guardar" Value="_BTTSAVE" ImageUrl="../Images/Icons/Enabled/SAVE.png">
                </asp:MenuItem>
                <asp:MenuItem Text="Salir" Value="_BTTEXIT" ImageUrl="../Images/Icons/Enabled/BACK.png">
                </asp:MenuItem>
            </Items>
        </asp:Menu>
    </div>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div class="DataHeader">
                <table id="TableDataHeader" cellpadding="0" cellspacing="0">
                    <tr>
                        <td colspan="3">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 10px">
                            &nbsp;
                        </td>
                        <td>
                            <table width="100%" cellpadding="1" cellspacing="2">
                                <tr>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td>
                                        Forma de Pago
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="ddlidFormaPago" runat="server" Width="150px"></asp:DropDownList>
                                    </td>
                                    <td>
                                        Fecha Inicio
                                    </td>
                                    <td colspan="2">
                                        <esd:esdDateTextBox ID="txtfeIniGroup" runat="server">
                                        </esd:esdDateTextBox>
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td>
                                        Fecha Fin
                                    </td>
                                    <td colspan="2">
                                        <esd:esdDateTextBox ID="txtfeFinGroup" runat="server">
                                        </esd:esdDateTextBox>
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td>
                                    </td>
                                    <td colspan="2">
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td style="width: 10px">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3">
                            &nbsp;
                        </td>
                    </tr>
                </table>
            </div>
            <div class="DataDetail" id="DataDetail" style="display: none;">
                <table cellpadding="0" cellspacing="0" width="100%">
                    <tr>
                        <td style="width: 15px;">
                            &nbsp;
                        </td>
                        <td>
                            <div class="ToolBarGrid" style="border: solid 1px #666; border-bottom: none;">
                                <table cellpadding="0" cellspacing="0" width="100%">
                                    <tr>
                                        <td>
                                            <asp:Menu ID="mnuGrid" runat="server" Orientation="Horizontal" CssClass="ToolBarControl"
                                                OnMenuItemClick="mnuGrid_MenuItemClick">
                                                <Items>
                                                    <asp:MenuItem Text="Agregar a Todos" Value="_BTTNEW" ImageUrl="../Images/Icons/Enabled/Add.png">
                                                    </asp:MenuItem>
                                                </Items>
                                            </asp:Menu>
                                        </td>
                                        <td align="right" style="width: 19px;">
                                            <asp:Button ID="bttBackYear" runat="server" CssClass="bttAntYear" OnClick="bttBackYear_Click" />
                                        </td>
                                        <td style="width: 5px;">
                                            &nbsp;
                                        </td>
                                        <td style="width: 40px; vertical-align: middle;">
                                            <asp:Label ID="lblYear" runat="server" CssClass="lblyear"></asp:Label>
                                        </td>
                                        <td style="width: 5px;">
                                            &nbsp;
                                        </td>
                                        <td align="right" style="width: 19px;">
                                            <asp:Button ID="bttNextYear" runat="server" CssClass="bttSigYear" OnClick="bttNextYear_Click" />
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </td>
                        <td style="width: 15px;">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 15px;">
                            &nbsp;
                        </td>
                        <td>
                            <esd:esdScheluder ID="scProgVaca" runat="server" SCTitulo="Personal" EnableViewState="false"
                                SCListItemValue="idPersonal" SCListItemText="dsPersonal" SCDataSecuen="nuSecuen"
                                SCDataFeIni="feVacaIni" SCDataFeFin="feVacaFin" SCDataStAnulaLog="stAnulado">
                            </esd:esdScheluder>
                        </td>
                        <td style="width: 15px;">
                            &nbsp;
                        </td>
                    </tr>
                </table>
            </div>
            <asp:HiddenField ID="hdnMsgOPB" runat="server" />
            <asp:HiddenField ID="hdnPnlPopup" runat="server" />
            <asp:HiddenField ID="hdnnuSecuen" runat="server" />
            <asp:HiddenField ID="hdnstAnulado" runat="server" />
            <asp:HiddenField ID="hdnSCWidth" runat="server" />
            <asp:HiddenField ID="hdnSCHeight" runat="server" />
            <asp:Panel runat="server" ID="PnlPopup" CssClass="modalPopup" Width="500px" Style="display: none;">
                <table width="100%" cellpadding="0" cellspacing="2">
                    <tr>
                        <td colspan="3">
                            <div class="modalPopupHeader">
                                &nbsp;&nbsp;&nbsp;<asp:Label ID="lblTitlePopup" runat="server"></asp:Label>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 5px;">
                            &nbsp;
                        </td>
                        <td>
                            <table width="100%" cellpadding="1" cellspacing="2">
                                <tr>
                                    <td colspan="13">
                                        &nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td>
                                        Codigo:
                                    </td>
                                    <td colspan="10">
                                        <esd:esdTextBox ID="txtidPersonal" runat="server" Width="80px">
                                        </esd:esdTextBox>
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td>
                                        Ape. y Nombres:
                                    </td>
                                    <td colspan="10">
                                        <esd:esdTextBox ID="txtdsPersonal" runat="server" Width="342px">
                                        </esd:esdTextBox>
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td>
                                        Fecha Inicio:
                                    </td>
                                    <td>
                                        <esd:esdDateTextBox ID="txtfeInicio" runat="server">
                                        </esd:esdDateTextBox>
                                    </td>
                                    <td style="width: 5px">
                                        &nbsp;
                                    </td>
                                    <td>
                                        Fecha Fin:
                                    </td>
                                    <td colspan="7">
                                        <esd:esdDateTextBox ID="txtfeFin" runat="server">
                                        </esd:esdDateTextBox>
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="13">
                                        &nbsp;
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td style="width: 5px;">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 5px;">
                            &nbsp;
                        </td>
                        <td align="right">
                            <esd:esdButton ID="bttOkPopup" runat="server" Text="Aceptar" Width="80px" OnClick="bttOkPopup_Click">
                            </esd:esdButton>
                            <esd:esdButton ID="bttCancelPopup" runat="server" Text="Cancelar" Width="80px"></esd:esdButton>
                        </td>
                        <td style="width: 5px;">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3">
                            &nbsp;
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            <ajax:ModalPopupExtender runat="server" ID="mdlPopup" PopupControlID="PnlPopup" BackgroundCssClass="modalBackground"
                TargetControlID="hdnPnlPopup">
            </ajax:ModalPopupExtender>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
